package com.chixing.service;


import com.chixing.entity.OrderBase;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chixing.entity.OrderDetail;
import com.chixing.entity.vo.OrderBaseWithDetailsVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 订单基础信息服务类
 * </p>
 *
 * @author smith
 * @since 2025-10-01
 */
public interface IOrderBaseService extends IService<OrderBase> {
    // 查询所有订单
    List<OrderBase> getAllOrders();

    // 根据ID查询订单
    OrderBase getOrderById(Integer id);

    // 新增订单及详情（强制绑定）
    boolean saveOrderWithDetails(OrderBase orderBase, List<OrderDetail> orderDetails);

    // 删除订单及详情（强制绑定）
    boolean removeOrderWithDetails(Integer orderId);

    // 更新订单
    boolean updateOrder(OrderBase orderBase);

    // 在IOrderBaseService.java中添加
    List<OrderBaseWithDetailsVO> getOrdersByUserIdAndStatusWithDetails(Integer userId, Integer status);
    List<OrderBaseWithDetailsVO> getOrdersByUserIdAndAllStatusWithDetails(Integer userId);
}
